#!/bin/bash

#Ganna Raboshchuk {ganna.raboshchuk@upc.edu}
#Updated: 21.11.2014
#UPC, Barcelona

#Block-based evaluation for the GMM-based system 
#(the files are already smoothed and merged).
#--------------------------------------------------------------------------

params__hypothesis_folder=$1
params__block_length=$2 #in seconds
params__labelling_folder=$3
params__class_of_interest=$4

params__corpus=( S3 S4 S11 S12 S13 S14 S15 S16 S17 S18 )
params__C_MS=0.3
params__C_FA=0.7

#Input/Output folders
params__reference_folder='/home/anna/Hospital/Segmentation/Alarms_detection/block-based-metric/reference/'
rm -fr ${params__reference_folder}
mkdir -p ${params__reference_folder}

#Reference creation (needed only once), includes last interval stats.
python Get_evaluation_interval_stats_last.py ${params__block_length} ${params__labelling_folder} ${params__reference_folder}
python Create_labels.py ${params__block_length} ${params__reference_folder} ${params__class_of_interest}

#Hypothesis creation
for params__test_session in ${params__corpus[@]}; do
    python Create_hypothesis_file.py ${params__block_length} "${params__hypothesis_folder}/${params__test_session}_out_smooth_merged.mmf" ${params__class_of_interest}
done 

python Compare_labels.py ${params__block_length} ${params__hypothesis_folder} ${params__reference_folder} ${params__test_session} ${params__C_MS} ${params__C_FA} ${params__class_of_interest}




